<template>
  <section class="page">
    <headerbar>电子档案</headerbar>

    <section class="inner-content">

      <div class="text-block">
        <div class="name color-default input-name">姓名：</div>
        <div class="value"><input v-model="data.userName" type="text"></div>
      </div>
      <div v-if="data.type==='shyk' && data.tabIndex==0" class="text-block">
        <div class="name color-default input-name">性别：</div>
        <div class="value"><input v-model="data.sex" type="text" placeholder="请选择性别"></div>
      </div>
      <div  class="text-block">
        <div class="name color-default input-name">出生年月：</div>
        <div class="value"><span class="mine-lists-content pdr-2">{{tools.formatDate(data.csrq)}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">民族：</div>
        <div class="value"><input type="text" placeholder="请输入主题" v-model="data.mz"></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">学历：</div>
        <div class="value"><span class="mine-lists-content pdr-2">{{data.xw}}</span></div>
      </div>
      <div class="text-block" >
        <div class="name color-default input-name">职称：</div>
        <div class="value"><input type="text"  v-model="data.dzbzw"></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">参加工作时间：</div>
        <div class="value"><span class="pdr-2">{{tools.formatDate(data.cjgzsj)}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">入党时间：</div>
        <div class="value"><span class="pdr-2">{{tools.formatDate(data.rdsj)}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">工作单位：</div>
        <div class="value"><input type="text" placeholder="请输入会议地点" v-model="data.gzdw"></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">职务：</div>
        <div class="value"><input type="text" placeholder="请选择主持人" v-model="data.dzbzw"></div>
      </div>
      <div class="text-block" @click="go('training')">
        <span class="title">培训情况</span>
        <i class="arrow"></i>
      </div>

      <!--<template v-for="item in data.pxqkList">

      <div class="text-block noborder">
        <div class="name color-default input-name">培训内容：</div>
      </div>
      <Textarea placeholder="">  </Textarea>

      <div class="text-block">
        <div class="name color-default input-name">培训时间：</div>
        <div class="value"><span class="pdr-2">{{item.pxsj}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">班级名称：</div>
        <div class="value"><span class="pdr-2">{{item.className}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">主办单位：</div>
        <div class="value"><span class="pdr-2">{{item.zbdw}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">培训机构（地点）：</div>
        <div class="value"><span class="pdr-2">{{item.pxdd}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">出勤：</div>
        <div class="value"><span class="pdr-2">{{item.zbdw}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">学时：</div>
        <div class="value"><span class="pdr-2">{{item.xs}}</span></div>
      </div>
      <div class="text-block">
        <div class="name color-default input-name">评价：</div>
        <div class="value"><span class="pdr-2">{{item.zbdw}}</span></div>
      </div>
      <div class="text-block noborder">
        <div class="name color-default input-name">总结：</div>
      </div>
      <Textarea placeholder="">  </Textarea>

      </template>-->

      <div class="mgt-10"></div>
      <div class="mgt-10"></div>
    </section>
  </section>
</template>

<script>
  import {Textarea} from 'cube-ui'
  import moment from 'moment'
  export default {
    components: {Textarea},
    name: 'eFile',
    data () {
      return {
        data: {
          type: '',
          subType: '',
          theme: '',
          typeLabel: '',
          attendUserId: '',
          attendUserName: '',
          compereUserId: '',
          compereUserName: '',
          recordEUserId: '',
          recordEUserName: '',
          address: '',
          meetStartTime: '',
          meetEndTime: '',
          subTypeLabel: '',
          tabIndex: 0,
          concentrated: 0,
          concentratedLabel: '',
          duration: '',
          durationLabel: ''
        },
        files: [],
        durationList: [],
        attachmentList: []
      }
    },
    created () {
      this.loadData()
    },
    methods: {
      loadData () {
        let userInfo = this.$localStorage.get('userInfo')
        let params = {
          userId: userInfo.id + ''
        }
        this.fetchService.getDzdaByUserId(params).then(res => {
          if (res.code !== 0) {
            return this.tools.tip(res.message)
          }
          this.data = res.data
        })
      },
      go (name) {
        this.$store.state.trainingData = this.data.pxqkList
        this.$router.push({name: name})
      }
    }
  }
</script>

<style scoped>

</style>
